﻿using Microsoft.Win32;
using System;
using System.Windows;
using System.Windows.Media.Imaging;

namespace TuTu.WpfApp.Views
{
    /// <summary>
    /// RegWindow.xaml 的交互逻辑
    /// </summary>
    public partial class RegWindow : Window
    {
        public RegWindow()
        {
            InitializeComponent();
        }
        private void canceBtn_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void uploadBtn_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "图片文件|*.jpg;*.png;*.jpeg";
            ofd.ShowDialog();
            string fileName= ofd.FileName;
            if (!string.IsNullOrWhiteSpace(fileName))
            {
                BitmapImage imgSource = new BitmapImage(new Uri(fileName, UriKind.Relative));
                this.imgHead.Source = imgSource;
            }
            
        }

        private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            this.DragMove();
        }

        private void minBtn_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        private void closeBtn_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
